# -*- coding: utf-8 -*-
# @Author  : longbhu
# @Time    : 2025/3/3 16:58
# @Function:
from calc_v1.tif_tools import multiply_tif_data_by_factor, sum_tif_files, sum_and_average_tif_pixels

# 将实物量分别相乘再相加

vwp_output = r'F:\code\dev\calc-gep-regulate-cqc\calc_v1\output\Qwp\vwp'
array_q_cod = multiply_tif_data_by_factor(r'F:\code\dev\calc-gep-regulate-cqc\calc_v1\output\Qwp\Qwp_COD_湿地生态系统_replaced_output.tif',
                                          r'F:\code\dev\calc-gep-regulate-cqc\calc_v1\output\Qwp\vwp\Vwp_COD_湿地生态系统_replaced_output.tif',1400)
array_q_tn = multiply_tif_data_by_factor(r'F:\code\dev\calc-gep-regulate-cqc\calc_v1\output\Qwp\Qwp_TN_湿地生态系统_replaced_output.tif',
                                         r'F:\code\dev\calc-gep-regulate-cqc\calc_v1\output\Qwp\vwp\Vwp_TN_湿地生态系统_replaced_output.tif',1750)
array_q_tp = multiply_tif_data_by_factor(r'F:\code\dev\calc-gep-regulate-cqc\calc_v1\output\Qwp\Qwp_TP_湿地生态系统_replaced_output.tif',
                                         r'F:\code\dev\calc-gep-regulate-cqc\calc_v1\output\Qwp\vwp\Vwp_TP_湿地生态系统_replaced_output.tif',2800)


array_v_wp = sum_tif_files(vwp_output,'Vwp_湿地.tif')

tif_path = r'F:\code\dev\calc-gep-regulate-cqc\calc_v1\output\Qwp\vwp\Vwp_湿地.tif'

total_sum, average_value = sum_and_average_tif_pixels(tif_path)

print(f"像素值总和: {total_sum}")
print(f"像素值平均值: {average_value}")